<?php
require_once 'Abstracts.php';

class AdminModel extends Abstracts{
	
	protected $_table  = 'pk_admin';
	public function info($id){
		$sql = "select * from {$this->_table} where id  = '{$id}'";
		return $this->getRow($sql);
	}
	
	public function isExistName($name,$id=null){
		if($id){
			$sql = "select id from {$this->_table} where username = '$name' and id <> '$id'";
		}else{
			$sql = "select id from {$this->_table} where username = '$name'";
		}		
		return $this->getRow($sql)?true:false;
	}
}